# This code is part of the MWP System
# Copyright (c) 2012 Benjamin Lubin (blubin@bu.com) 
# Published under and subject to the GPLv2 license available at http://www.gnu.org/licenses/gpl-2.0.html

'''
Created on Dec 18, 2012
@author: blubin
'''

from frontend.roleApplication import RoleApplication;
from frontend.form import Type;

class PublishBook(RoleApplication):
    """ The PharmacistAsst User Interface """

    def __init__(self):
        super(PublishBook, self).__init__("BookPublishing", "Publisher");
        #self.register_transition_step("publishbook", self.fill_prescription_form_creator, name_fields=["sequence", "AuthorFirstName", "AuthorLastName"]);
        self.register_sink_step("publishbook", self.publish_book, name_fields=["sequence", "AuthorFirstName", "AuthorLastName", "BookTitle"])
        #self.register_sink_step("TaskName", self.prepare_drink_form_creator, name_fields=["sequence", "FieldName1", "FieldName2"])

    def publish_book(self, stepname, form):
        form.add_task_label(fields=["AuthorFirstName", "AuthorLastName", "BookTitle"]);
        form.add_field(Type.CURRENCY, "BookCost");


if __name__ == '__main__':
    app = PublishBook();
    app.MainLoop();